﻿<div ng-controller="lookUpCookMaterial">
    <div class="page-header text-info" >
        <h4>关联食材详细信息：</h4>
    </div>
    <table class="table table-hover table-bordered p0m0">
        <thead>
        <tr>
            <th class="col-sm-1">食材名称</th>
            <th class="col-sm-1">食材类型</th>
            <th class="col-sm-1">数量</th>
            <th class="col-sm-2">单价</th>
            <th class="col-sm-2">总价</th>
        </tr>
        </thead>
        <tbody ng-if="!loadingState">
        <tr ng-repeat="item in list">
            <!--烹饪关系集合-->
            <td>{{item.Name}}</td>
            <td ng-if="!item.isModified">{{item.Category|enumVals:'MaterialCategory'}}</td>
            <td ng-if="item.isModified">
                <select ng-model="item.Category" ng-options="choose.Val as choose.Name for choose in Categories" class="form-control"> </select>
            </td>
            <td ng-if="!item.isModified">{{item.Number}}</td>
            <td ng-if="item.isModified"><input type="number" class="form-control" ng-model="item.Number"/></td>
            <td>{{item.UnitPrice|currency:'¥'}}/{{item.Unit|enumVals:'Unit'}}</td><!--单价-->
            <td ng-if="!item.isModified">{{item.Price|currency:'¥'}}</td><!--总计价格-->
            <td ng-if="item.isModified"><input type="text" class="form-control" value="{{item.UnitPrice*item.Number}}"/></td>
        </tr>
        </tbody>
        <tbody ng-if="loadingState">
            <tr>
                <td colspan="8" class="text-center">
                    <img width="60" src="/App/images/loading.gif" />
                </td>
            </tr>
        </tbody>
    </table>
</div>
